package bio.chatproject.client;


import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;

/**
 * @author charwayH
 */
public class ClientReader extends Thread {

    private Socket socket;
    private int flag;
    private String name;


    public ClientReader(Socket socket,int flag,String name){
        this.socket = socket;
        this.flag = flag;
        this.name = name;
    }

    @Override
    public void run() {
        DataOutputStream dos = null;
        try {
            dos = new DataOutputStream(socket.getOutputStream());
            dos.writeInt(flag);
            dos.writeUTF(name);
            dos.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
